package com.rd.student.jiaji.class3.xumingze;

import java.util.LinkedList;

public class MajorFind {

//    Scanner scanner = new Scanner(System.in);
//    String type = scanner.next();
    public void majorFd(LinkedList list,String type){
        int j=0;
        for (int i=0;i<list.size();i++){
            Student student=(Student) list.get(i);
            if (type==student.getMajor()){
                System.out.println(list.get(i));
                j++;
            }
        }
        System.out.println(type+"专业有"+j+"人");

    }
}

